package com.undsf.despot;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.undsf.despot.actors.ng.Menu;
import com.undsf.despot.scenes.CombatStage;

public class MyGdxGame extends ApplicationAdapter {
	SpriteBatch batch;
	CombatStage combatScene;
	Menu menu;
	
	@Override
	public void create () {
		batch = new SpriteBatch();
		combatScene = new CombatStage();
		menu = new Menu(112, 48);
		menu.setMenuTableSize(2, 2);
		menu.setMenuItemSize(64, 16);
		menu.addMenuItem(0, 0, "Attack", "attack");
		menu.addMenuItem(1, 0, "防御", "defense");
		menu.addMenuItem(0, 1, "咒文", "cast");
		menu.addMenuItem(1, 1, "Item", "item");
		menu.setPosition(112, 168);
		combatScene.addActor(menu);
	}

	@Override
	public void render () {
		Gdx.gl.glClearColor(0, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.begin();
		combatScene.draw();
		batch.end();
	}
	
	@Override
	public void dispose () {
		batch.dispose();
	}
}
